package com.ccys.doctor.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.entity.TblMemberSummary;
import com.ccys.db.mapper.TblMemberSummaryMapper;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.doctor.memberSummary.GetMemberSummaryVo;
import com.ccys.doctor.service.MemberSummaryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: WhiteCoat
 * @description: MemberSummary相关接口
 * @author: ZhangJingCan
 * @create: 2024-02-07 16:53
 **/

@Service
public class MemberSummaryServiceImpl extends BaseServiceImpl<TblMemberSummary> implements MemberSummaryService {

    @Resource
    private TblMemberSummaryMapper tblMemberSummaryMapper;

    @Override
    public ResponseResultApp<List<GetMemberSummaryVo>> getMemberSummary(String memberId) {
        if (ObjectUtil.isEmpty(memberId)){
            return ResponseResultApp.error("illegal parameter");
        }
        List<GetMemberSummaryVo> list = tblMemberSummaryMapper.getMemberSummary(memberId);
        return ResponseResultApp.success(list);
    }
}
